angular.module('News').config(['$routeProvider', function ($routeProvider) {
  $routeProvider
    .when('/', {
      templateUrl:'main.html',
      controller:'MainController'
    })
    .when('/login', {
      templateUrl:'login.html',
      controller:'LoginController',
      resolve: ['$http' , '$locale', 'TranslationService',
        function($http,$locale,TranslationService){
          return $http.get('../languages/'+$locale.id+'.json').
            success(function(data, status){
              TranslationService.lang = data;
            });
        }]
    })
    .otherwise({
      redirectTo:'/'
    });
}]);
